<template>
  <v-card
      :loading="loading"
      class="mx-auto my-12"
      max-width="374"
  >
    <template slot="progress">
      <v-progress-linear
          color="light-green"
          height="10"
          indeterminate
      ></v-progress-linear>
    </template>

<!--    <v-img-->
<!--        height="90"-->
<!--        :src="doubanImg(item.company_logo)"-->
<!--    ></v-img>-->

    <v-card-title>{{item.title}}
      <span class="ml-3" style="font-size: 2px;"></span>
    </v-card-title>

    <v-card-text>
      <v-row
          align="center"
          class="mx-0"
      >
<!--        <v-rating-->
<!--            :value="item.rate/2.0"-->
<!--            color="amber"-->
<!--            dense-->
<!--            half-increments-->
<!--            readonly-->
<!--            size="14"-->
<!--        ></v-rating>-->
        <div class="grey--text ms-4">
          年份： {{item.year}}
        </div>
<!--        <div class="grey&#45;&#45;text ms-4">-->
<!--          年份： {{item.year}} 元-->
<!--        </div>-->
<!--        <div class="grey&#45;&#45;text ms-4">-->
<!--          企业性质：{{item.coattr}}·{{item.nation}}-->
<!--        </div>-->
<!--        <div class="grey&#45;&#45;text ms-4">-->
<!--          学历要求：{{item.degree}}-->
<!--        </div>-->
<!--        <div class="grey&#45;&#45;text ms-4">-->
<!--          公司规模：{{item.cosize0}} - {{item.cosize1}}-->
<!--        </div>-->
      </v-row>

<!--      <div class="my-2 text-subtitle-1">-->
<!--        企业性质：{{item.coattr}}·{{item.nation}}-->
<!--      </div>-->

<!--      <div class="my-2 text-subtitle-1">-->
<!--        学历要求：{{item.degree}}-->
<!--      </div>-->

      <div>{{item.intro}}</div>
    </v-card-text>

    <v-divider class="mx-4"></v-divider>

    <v-card-title>试卷及解析</v-card-title>

<!--    <v-card-text>-->
<!--      <v-chip-group-->
<!--          v-model="selection"-->
<!--          active-class="deep-purple accent-4 white&#45;&#45;text"-->
<!--          column-->
<!--      >-->
<!--        <v-chip v-for="(i,idx) in item.welfare.split(',')" :key="idx">{{i}}</v-chip>-->
<!--      </v-chip-group>-->
<!--    </v-card-text>-->

    <v-card-actions>
      <v-btn
          color="deep-purple lighten-2"
          text
          @click="reserve(item.papers_file_path)">
        试卷详情
      </v-btn>
      <v-btn
          color="deep-purple accent-2"
          text
          @click="reserve(item.answer_file_path)">
        答案解析
      </v-btn>
    </v-card-actions>
  </v-card>
</template>

<script>
export default {
  name: "exam-paper",
  props: {
    item: Object,
    cardTitle: String
  },
  data: () => ({
    loading: false,
    selection: -1,
  }),
  methods: {
    // doubanImg(src) {
    //   let trueSrc = ''
    //   if(src!=null && src.startsWith("http://localhost:8080"))
    //     trueSrc = src
    //   else if(src!=null && src!='')
    //     trueSrc = 'https://images.weserv.nl/?url=' + src
    //   else
    //     trueSrc = require("@/assets/nologo.png")
    //   return trueSrc
    // },
    reserve (url) {
      this.loading = true
      setTimeout(() => {
            this.loading = false
            window.open(url)
          }
      , 2000)
    },
  },
};
</script>

<style scoped>
</style>
